<template>
    <div>
        <div class="recommend-title">热门推荐</div>
        <ul>
            <li
            class="item border-bottom"
            v-for="item of recommendList"
            :key="item.id"
            >
                <img :src="item.imageUrl" alt="推荐图片" class="item-img">
                <div class="item-info">
                    <p class="item-title">{{ item.title }}</p>
                    <p class="item-desc">{{ item.desc }}</p>
                    <button class="item-button">查看详情</button>
                </div>
            </li>
        </ul>
    </div>
</template>
<script>
export default {
    name: 'HomeRecommend',
    data () {
        return{
            recommendList: [{
                id: '001',
                imageUrl: 'static/images/commen-01.jpg',
                title: '梁星琪',
                desc: '爱好：一堆东西，购物、逛街、上网、游游泳、读书、看电视剧。'
            },
            {
                id: '002',
                imageUrl: 'static/images/commen-01.jpg',
                title: '梁星琪',
                desc: '爱好：一堆东西，购物、逛街、上网、游游泳、读书、看电视剧。'
            },{
                id: '003',
                imageUrl: 'static/images/commen-01.jpg',
                title: '梁星琪',
                desc: '爱好：一堆东西，购物、逛街、上网、游游泳、读书、看电视剧。'
            },{
                id: '004',
                imageUrl: 'static/images/commen-01.jpg',
                title: '梁星琪',
                desc: '爱好：一堆东西，购物、逛街、上网、游游泳、读书、看电视剧。'
            },{
                id: '005',
                imageUrl: 'static/images/commen-01.jpg',
                title: '梁星琪',
                desc: '爱好：一堆东西，购物、逛街、上网、游游泳、读书、看电视剧。'
            },]
        }
    }
}
</script>
<style scoped lang="stylus">
@import '~styles/mixins.styl'
.recommend-title
    line-height .8rem
    background-color #eee
    text-indent .2rem 
.item
    overflow hidden
    display flex
    height 2.5rem
    .item-img
        width 1.8rem
        height 2.3rem
        padding .1rem
        border-radius .2rem
    .item-info
        flex 1
        padding .1rem
        // 三个点不出现解决方法
        min-width 0
        .item-title
            line-height .54rem
            font-size .32rem
            ellipsis()
        .item-desc
            line-height .4rem
            color #ccc
            ellipsis()
        .item-button
            line-height .44rem
            margin-top .2rem
            padding 0 .2rem
            background #ff9300
            border-radius .06rem
            color #fff
</style>
